import fetch from './fetch';

// app用户评论列表
export function listUserComment(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/listUserComment/'+json.PAGE+'/'+json.ROWS,
        method: 'post',
        data
    });
}
// app用户评论回复
export function listUserReply(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/listUserReply/'+json.PAGE+'/'+json.ROWS,
        method: 'post',
        data
    });
}
// 让家长报名
export function letParentEnroll(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/letParentEnroll',
        method: 'post',
        data
    });
}
// 取消订单
export function updateOrder(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/updateOrder',
        method: 'post',
        data
    });
}
// 添加回复

export function insertReply(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/insertReply',
        method: 'post',
        data
    });
}
// 添加评论
export function insertComment(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/insertComment',
        method: 'post',
        data
    });
}
// 查询评论
export function selectCommentByCourse(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/selectCommentByCourse',
        method: 'post',
        data
    });
}
// 分页查询我的课程
export function pageMyCourse(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/pageMyCourse',
        method: 'post',
        data
    });
}
// 分页查询我的收藏
export function pageMyCollection(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/pageMyCollection',
        method: 'post',
        data
    });
}
// 分页查询我的关注
export function pageMyFllow(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/pageMyFllow',
        method: 'post',
        data
    });
}
// 分页查询我的订单
export function pageMyOrder(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/pageMyOrder',
        method: 'post',
        data
    });
}
// 购买
export function saveOrder(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/saveOrder',
        method: 'post',
        data
    });
}

// 查询课时详情
export function getCoursePartById(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/getCoursePartById',
        method: 'post',
        data
    });
}

// 添加关注
export function insertFllow(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/homepage/insertFllow',
        method: 'post',
        data
    });
}

// 取消关注
export function deleteFllow(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/homepage/deleteFllow',
        method: 'post',
        data
    });
}
// 课程中的老师介绍
export function getTeacherByUserId(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/homepage/getTeacherByUserId',
        method: 'post',
        data
    });
}

// 查询课程详情-》课程目录的列表
export function getCourseById(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/getCourseById',
        method: 'post',
        data
    });
}


// 取消收藏
export function deleteCollect(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/deleteCollect',
        method: 'post',
        data
    });
}

// 添加收藏
export function insertCollect(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/insertCollect',
        method: 'post',
        data
    });
}

// 查找学生家长
export function listParents(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/listParents',
        method: 'post',
        data
    });
}

// 获取e学云支付余额
export function queryExueyunMoney(json) {
    const data = { ...json };
    return fetch({
        url: '/eke/course/queryExueyunMoney',
        method: 'post',
        data
    });
}

// 分页查询老师课程列表 
export function getTeacherCourse(json) {
    const data = { ...json.sendData };
    var page = json.page;
    var rows = json.rows;
    return fetch({
        url: `/eke/homepage/getTeacherCourse/${page}/${rows}`,
        method: 'post',
        data
    });
}

